<?php echo $header; ?>
<div class="page">
	<div class="personal_info">
    	Welcome,<span id="userName"><?php echo $this->customer->getLastName() ?></span>
					<a href="index.php?route=account/logout">logout</a>
    </div>
	<div class="greenPanel">
		<table width="95%" cellpadding="0" cellspacing="0" align="center" style="margin:auto;">
			<tr>
				<td colspan="3" align="left" height="50px">
					<a href="javascript:void(0)" style="float:left;background:url(catalog/view/theme/default/images/agreeItem.png);padding:8px 70px 17px 62px;">Account</a>
				</td>
			</tr>
			<tr>
				<?php echo $left; ?>
				<td style="height:500px;" valign="top" class="ManageMain">
					<ul>
						<li>Wish List</li>
					</ul>
					<?php if ($success) { ?>
					<div class="success"><?php echo $success; ?></div>
					<?php } ?>
					<?php if ($products) { ?>
						<table cellpadding="0" cellspacing="0" border="0" width="100%">
						<tr>
							<td height="30">
								<input id="select" type="checkbox" onclick="select_all()"  />All select 
								<!-- <input type="button" value="Add to cart" class="button" onclick="add()"  /> --> 
								<input type="button" value="Delect" class="submit_button" onclick="del()" /> 
							</td>
						</tr>
						<tr>
						<td>
						<table width="100%" cellspacing="0" cellpadding="0" class="list">
						<tr>
						<th>&nbsp;</th>
						<th width="10%">Products</th>
						<th width="30%">Products Name</th>
						<th width="15%">Date Added</th>
						<th width="10%">Price</th>
						<th width="15%">Stockpile</th>
						<th width="15%">Action</th>
						</tr>
						<?php foreach ($products as $product) { ?>
						<tr id="wishlist-row<?php echo $product['product_id']; ?>">
						<td><input type="checkbox"  class="checkbox_s" name="checkbox" value="<?php echo $product['product_id']; ?>" /></td>
						<td>
						<?php if ($product['thumb']) { ?>
						<a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" /></a>
						<?php } ?></td>
						<td><a href="<?php echo $product['href']; ?>"  title="<?php echo $product['old_name']?>"><?php echo $product['name']; ?></a></td>
						<td><?php echo $product['model']; ?></td>
						<td><?php if ($product['price']) { ?>
							<div class="price">
							<?php if (!$product['special']) { ?>
							<?php echo $product['price']; ?>
							<?php } else { ?>
							<s><?php echo $product['price']; ?></s> <b><?php echo $product['special']; ?></b>
							<?php } ?>
							</div>
							<?php } ?>
						</td>
						<td><?php echo $product['stock']; ?></td>
						<td><a href="javascript:void(0)" onclick="addToCart('<?php echo $product['product_id']; ?>');">Add to cart</a></br>
						<a href="<?php echo $product['remove']; ?>">Delete</a></td>
						</tr>

						<?php }?>
						</table>
						</td>
						</tr>
						</table>
                    </td>
              </tr>
              <tr>
                <td></td>
              </tr>
            </table>
					<?php }?>
				</td>
			</tr>
		</table>
	</div>
</div>
<script type="text/javascript">
	function select_all(){
		if($("#select").attr('checked')=='checked'){
			$('.checkbox_s').attr('checked',true);
		}else{
			$('.checkbox_s').attr('checked',false);		
		}
	}
	function add(){
		$('.checkbox_s:checked').each(function(){
			addToCart($(this).val());
		})
	}
	function del(){
		str="";
		$('.checkbox_s:checked').each(function(ids){
			str+=$(this).val()+","
		})
		window.location.href="index.php?route=account/wishlist&remove="+str;
	}
</script>

<?php echo $footer; ?> 
